package com.ruibang.glass.equipment.entity.device;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.teaming.cloud.framework2.common.pojo.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 设备-设备管理
 * </p>
 *
 * @author mameng
 * @since 2024-04-07
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "EquipmentDeviceInfo对象", description = "设备-设备管理")
@TableName(value = "g_equipment_device_info")
public class EquipmentDeviceInfo extends BaseEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "设备id")
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private String id;

    @ApiModelProperty(value = "设备代码")
    private String deviceCode;

    @ApiModelProperty(value = "设备名称")
    private String deviceName;

    @ApiModelProperty(value = "厂房")
    private String warehouseName;

    @ApiModelProperty(value = "厂房Id")
    private String warehouseId;

    @ApiModelProperty(value = "产线")
    private String productLine;

    @ApiModelProperty(value = "工序")
    private String workingProcedure;

    @ApiModelProperty(value = "区域")
    private String areaName;

    @ApiModelProperty(value = "区域Id")
    private String areaId;

    @ApiModelProperty(value = "投产日期")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @JSONField(format = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private LocalDate useTime;

    @ApiModelProperty(value = "使用年限")
    private Float useDay;

    @ApiModelProperty(value = "状态 0:运行，1:停机，字典类型：equipment_status")
    private String status;

    @ApiModelProperty(value = "产线id")
    private String productLineId;

    @ApiModelProperty(value = "工序id")
    private String workingProcedureId;

    @ApiModelProperty(value = "设备Id")
    @TableField(exist = false)
    private String deviceId;

    @TableField(exist = false)
    private List<DeviceChild> deviceChildList;

    @TableField(exist = false)
    private List<String> ids;

    @TableField(exist = false)
    private List<String> childIdList;

    @TableField(exist = false)
    private Boolean disabled;
    @ApiModelProperty(value = "是否删除(1：是 0：否)")
    @TableLogic
    private String isDelete;
}
